<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./MasterPageHome.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="Title">
        Title
    </ui:define>

    <ui:define name="content">
        <h:form enctype="multipart/form-data">
            <table width="100%" cellspacing="10">
                <tr>
                    <td>
                        Tittle:
                    </td>
                    <td>
                        <p:inputText 
                            id="txttittle"
                            required="true"
                            requiredMessage="Tittle is required"
                            value="#{leaseMB.title}"
                            style="width: 250px">
                            
                        </p:inputText>
                    </td>
                    <td>
                        <p:message id="MessageForTittle" for="txttittle"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Date Up:
                    </td>
                    <td>
                        <p:calendar
                            id="txtdateup"
                            pattern="MM/dd/yyyy"
                            yearRange="c-50:c+50"
                            navigator="true"
                            size="22"
                            required="true"
                            value="#{leaseMB.date}"
                            disabled="true"
                            style="width: 250px">

                        </p:calendar>
                    </td>
                    <td>
                         <p:message id="MessageForCalendar" for="txtdateup"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Square footage Earth:
                    </td>
                    <td>
                        <p:inputText 
                            id="txtearth"
                            required="true"
                            requiredMessage="Square footage Earth is required"
                            value="#{leaseMB.squarefootageEarth}"
                            style="width: 250px">

                        </p:inputText>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        Square footage House:
                    </td>
                    <td>
                        <p:inputText 
                            id="txhouse"
                            required="true"
                            requiredMessage="Square footage House is required"
                            value="#{leaseMB.squarefootageHouse}"
                            style="width: 250px">
                        </p:inputText>
                    </td>
                    <td>

                    </td>
                </tr>
                <tr>
                    <td>
                        City:
                    </td>
                    <td>
                        <p:inputText
                            id="txtcity"
                            required="true"
                            requiredMessage="City is required"
                            value="#{leaseMB.city}"
                            style="width: 250px">
                        </p:inputText>
                    </td>
                    <td>
                        <p:message id="MessageForCity" for="txtcity"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Details Location:
                    </td>
                    <td>
                        <p:inputTextarea
                            autoResize="false"
                            id="txtlocation"
                            required="true"
                            requiredMessage="Details Location is required"
                            value="#{leaseMB.location}"
                            style="width: 250px">
                        </p:inputTextarea>
                    </td>
                    <td>
                        <p:message id="MessageForDetaillocation" for="txtlocation"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Type Of House:
                    </td>
                    <td>
                        <h:selectOneMenu id="txttypehouse" value="#{leaseMB.typehouse}" style="width: 250px">
                            <f:selectItem itemLabel="Home" itemValue="Home"/>
                            <f:selectItem itemLabel="Villa" itemValue="Villa"/>
                            <f:selectItem itemLabel="Apartment" itemValue="Apartment"/>
                            <f:selectItem itemLabel="Commercial Area" itemValue="Commercial Area"/>
                        </h:selectOneMenu>
                    </td>
                    <td>

                    </td>
                </tr>
                <tr>
                    <td>Rooms:</td>
                    <td>
                        Bedroom:
                        <h:selectOneMenu id="txtbedroom" value="#{leaseMB.bedroom}">
                            <f:selectItem itemLabel="1" itemValue="1"/>
                            <f:selectItem itemLabel="2" itemValue="2"/>
                            <f:selectItem itemLabel="3" itemValue="3"/>
                            <f:selectItem itemLabel="4" itemValue="4"/>
                            <f:selectItem itemLabel="5" itemValue="5"/>
                            <f:selectItem itemLabel="6" itemValue="6"/>
                            <f:selectItem itemLabel="7" itemValue="7"/>
                            <f:selectItem itemLabel="8" itemValue="8"/>
                            <f:selectItem itemLabel="9" itemValue="9"/>
                            <f:selectItem itemLabel="10" itemValue="10"/>
                            <f:selectItem itemLabel="11" itemValue="11"/>
                            <f:selectItem itemLabel="12" itemValue="12"/>
                            <f:selectItem itemLabel="13" itemValue="13"/>
                            <f:selectItem itemLabel="14" itemValue="14"/>
                            <f:selectItem itemLabel="15" itemValue="15"/>
                            <f:selectItem itemLabel="16" itemValue="16"/>
                            <f:selectItem itemLabel="17" itemValue="17"/>
                            <f:selectItem itemLabel="18" itemValue="18"/>
                            <f:selectItem itemLabel="19" itemValue="19"/>
                            <f:selectItem itemLabel="20" itemValue="20"/>
                            <!--<f:selectItem itemLabel="21" itemValue="21"/>
                            <f:selectItem itemLabel="22" itemValue="22"/>
                            <f:selectItem itemLabel="23" itemValue="23"/>
                            <f:selectItem itemLabel="24" itemValue="24"/>
                            <f:selectItem itemLabel="25" itemValue="25"/>
                            <f:selectItem itemLabel="26" itemValue="26"/>
                            <f:selectItem itemLabel="27" itemValue="27"/>
                            <f:selectItem itemLabel="28" itemValue="28"/>
                            <f:selectItem itemLabel="29" itemValue="29"/>
                            <f:selectItem itemLabel="30" itemValue="30"/>-->
                        </h:selectOneMenu>
                        Bathroom:
                        <h:selectOneMenu id="txtbathroom" value="#{leaseMB.bathroom}">
                            <f:selectItem itemLabel="1" itemValue="1"/>
                            <f:selectItem itemLabel="2" itemValue="2"/>
                            <f:selectItem itemLabel="3" itemValue="3"/>
                            <f:selectItem itemLabel="4" itemValue="4"/>
                            <f:selectItem itemLabel="5" itemValue="5"/>
                            <f:selectItem itemLabel="6" itemValue="6"/>
                            <f:selectItem itemLabel="7" itemValue="7"/>
                            <f:selectItem itemLabel="8" itemValue="8"/>
                            <f:selectItem itemLabel="9" itemValue="9"/>
                            <f:selectItem itemLabel="10" itemValue="10"/>
                            <f:selectItem itemLabel="11" itemValue="11"/>
                            <f:selectItem itemLabel="12" itemValue="12"/>
                            <f:selectItem itemLabel="13" itemValue="13"/>
                            <f:selectItem itemLabel="14" itemValue="14"/>
                            <f:selectItem itemLabel="15" itemValue="15"/>
                            <f:selectItem itemLabel="16" itemValue="16"/>
                            <f:selectItem itemLabel="17" itemValue="17"/>
                            <f:selectItem itemLabel="18" itemValue="18"/>
                            <f:selectItem itemLabel="19" itemValue="19"/>
                            <f:selectItem itemLabel="20" itemValue="20"/>
                            <!--<f:selectItem itemLabel="21" itemValue="21"/>
                            <f:selectItem itemLabel="22" itemValue="22"/>
                            <f:selectItem itemLabel="23" itemValue="23"/>
                            <f:selectItem itemLabel="24" itemValue="24"/>
                            <f:selectItem itemLabel="25" itemValue="25"/>
                            <f:selectItem itemLabel="26" itemValue="26"/>
                            <f:selectItem itemLabel="27" itemValue="27"/>
                            <f:selectItem itemLabel="28" itemValue="28"/>
                            <f:selectItem itemLabel="29" itemValue="29"/>
                            <f:selectItem itemLabel="30" itemValue="30"/>-->
                        </h:selectOneMenu>
                        Livingroom:
                        <h:selectOneMenu id="livingroom" value="#{leaseMB.livingroom}">
                            <f:selectItem itemLabel="0" itemValue="0"/>
                            <f:selectItem itemLabel="1" itemValue="1"/>
                            <f:selectItem itemLabel="2" itemValue="2"/>
                            <f:selectItem itemLabel="3" itemValue="3"/>
                            <f:selectItem itemLabel="4" itemValue="4"/>
                            <f:selectItem itemLabel="5" itemValue="5"/>
                            <f:selectItem itemLabel="6" itemValue="6"/>
                            <f:selectItem itemLabel="7" itemValue="7"/>
                            <f:selectItem itemLabel="8" itemValue="8"/>
                            <f:selectItem itemLabel="9" itemValue="9"/>
                            <f:selectItem itemLabel="10" itemValue="10"/>
                            <!--<f:selectItem itemLabel="11" itemValue="11"/>
                            <f:selectItem itemLabel="12" itemValue="12"/>
                            <f:selectItem itemLabel="13" itemValue="13"/>
                            <f:selectItem itemLabel="14" itemValue="14"/>
                            <f:selectItem itemLabel="15" itemValue="15"/>
                            <f:selectItem itemLabel="16" itemValue="16"/>
                            <f:selectItem itemLabel="17" itemValue="17"/>
                            <f:selectItem itemLabel="18" itemValue="18"/>
                            <f:selectItem itemLabel="19" itemValue="19"/>
                            <f:selectItem itemLabel="20" itemValue="20"/>
                            <f:selectItem itemLabel="21" itemValue="21"/>
                            <f:selectItem itemLabel="22" itemValue="22"/>
                            <f:selectItem itemLabel="23" itemValue="23"/>
                            <f:selectItem itemLabel="24" itemValue="24"/>
                            <f:selectItem itemLabel="25" itemValue="25"/>
                            <f:selectItem itemLabel="26" itemValue="26"/>
                            <f:selectItem itemLabel="27" itemValue="27"/>
                            <f:selectItem itemLabel="28" itemValue="28"/>
                            <f:selectItem itemLabel="29" itemValue="29"/>
                            <f:selectItem itemLabel="30" itemValue="30"/>-->
                        </h:selectOneMenu>
                    </td>
                    <td>

                    </td>
                </tr>
                <tr>
                    <td>
                        Deposit: 
                    </td>
                    <td>
                        <p:spinner 
                            style="width: 250px"
                            id="txtprice"
                            prefix="$"
                            required="true"
                            requiredMessage="Price is required"
                            value="#{sellerMB.deposit}">
                            <p:ajax update="messageForPrice" event="keyup"/>
                            <p:ajax update="messageForPrice" event="blur"/>
                        </p:spinner>
                    </td>
                    <td>
                        <p:message id="messageForPrice" for="txtprice"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Introduction:
                    </td>
                    <td>
                        <p:inputTextarea 
                            autoResize="false"
                            id="txtintroduction" 
                            required="true" 
                            requiredMessage="Introduction is required"
                            value="#{leaseMB.introduction}"
                            style="width: 250px"/> 
                    </td>
                    <td>
                        <p:message id="messageforIntroduction" for="txtintroduction"/>                        
                    </td>
                </tr>
                <tr>
                    <td>
                        Type Payment:
                    </td>
                    <td>
                        <p:inputText id="txtpayment"
                                     required="true"
                                     requiredMessage="Payment id required"
                                     value="#{leaseMB.payment}"
                                     style="width: 250px"/>
                    </td>
                    <td>
                        <p:message id="messagepayment" for="txtpayment"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Link Map Google:
                    </td>
                    <td>
                        <p:inputTextarea 
                            autoResize="false"
                            id="txtmap"
                            required="true"
                            requiredMessage="You must have Maps"
                            value="#{leaseMB.linkmap}"
                            style="width: 250px"/>
                    </td>
                    <td>
                        <p:message id="messageformap" for="txtmap"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <p:panel id="albumPanel" style="margin: 15px 0px 7px 0px">
                            <p:fileUpload 
                                fileUploadListener="#{leaseMB.handleFileUpload}"
                                update="photos"
                                multiple="true"                    
                                allowTypes="/(\.|\/)(gif|jpe?g|png|bmp)$/"
                                style="margin: 10px">
                            </p:fileUpload>
                            <h:panelGroup id="photos">
                                <ui:repeat value="#{leaseMB.photos}" var="photo">
                                    <div class="one-pic">
                                        <p:graphicImage 
                                            value="#{photo.linkImageHouse}" 
                                            width="200" 
                                            height="150" />
                                    </div>
                                </ui:repeat>
                                <div class="clear"></div>
                            </h:panelGroup>
                            
                        </p:panel>
                        
                    </td>
                </tr>
                <tr>
                    <td>

                    </td>
                    <td align="left">
                        <p:commandButton value="Submit" id="buttonsubmit" action="#{leaseMB.Addlease}" ajax="false"/>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <p:commandButton type="reset" value="Reset"/>
                    </td>
                    <td>
                        
                    </td>
                </tr>
            </table>
        </h:form>
    </ui:define>

</ui:composition>
